package net.techwatch.gwt.mvp.client.event;

import com.google.gwt.event.shared.GwtEvent;

public class SubmitEvent extends GwtEvent<SubmitEventHandler> {

	private static Type<SubmitEventHandler> TYPE;
	
	private String msg;
	
	public SubmitEvent(String msg) {
		this.msg = msg;
	}
	
	public String getMsg() {
		return msg;
	}
	
	public static Type<SubmitEventHandler> getType() {
		if(TYPE == null)
			TYPE = new Type<SubmitEventHandler>();
		
		return TYPE;
	}
	
	@Override
	protected void dispatch(SubmitEventHandler handler) {
		handler.onSubmit(this);
	}

	@Override
	public Type<SubmitEventHandler> getAssociatedType() {
		return getType();
	}

}
